package com.project.springboot.goodcode.standardbuilder;

/**
 * description: 电脑实体类（完整构造者模式）
 * @author 朱正磊
 * @date 2024-09-19 09:09:59
 */
public class Computer1 {

    // 必须
    private final String cpu;
    // 必须
    private final String ram;
    // 可选
    private int usbCount;
    // 可选
    private String keyboard;
    // 可选
    private String display;

    public Computer1(String cpu, String ram) {
        this.cpu = cpu;
        this.ram = ram;
    }

    public void setUsbCount(int usbCount) {
        this.usbCount = usbCount;
    }

    public void setKeyboard(String keyboard) {
        this.keyboard = keyboard;
    }

    public void setDisplay(String display) {
        this.display = display;
    }

    @Override
    public String toString() {
        return "Computer1{" +
                "cpu='" + cpu + '\'' +
                ", ram='" + ram + '\'' +
                ", usbCount=" + usbCount +
                ", keyboard='" + keyboard + '\'' +
                ", display='" + display + '\'' +
                '}';
    }

}
